{% extends 'pybb/base.html' %}
{% load pybb_tags %}
{% load i18n %}

{% block title %}
{{ forum }}
{% endblock %}

{% block pybb_crumbs %}
<a href="{% url pybb_index %}">Forum</a> &raquo;
<a href="{{ forum.category.get_absolute_url }}">{{ forum.category }}</a>
{% endblock %}

{% block pybb_content %}
<div class="forum-details">
    <h2 class="name">{{ forum }}</h2>
    <table class="topic-list">
        <thead>
            <tr>
                <th class="name">topic</th>
                <th class="post-count">post</th>
                <th class="recent-info">recent info</th>
            </tr>
        </thead>
        {% for topic in page.object_list %}
        <tr class="topic-item">
            <td class="title">
                {% if topic.sticky %}<span class="sticky"></span>{% endif %}
                {% if topic|pybb_topic_unread:user %}<span class="unread"></span>{% endif %}
                {% if topic.closed %}{% trans "Closed" %}:{% endif %}
                {% if topic.sticky %}{% trans "Important" %}:{% endif %}
                <a href="{{ topic.get_absolute_url }}">{{ topic }}</a>
                <div class="mini-pagination">{% pybb_topic_mini_pagination topic %}</div>
            </td>
            <td class="post-count">{{ topic.post_count }}</td>
            <td class="recent-info">{% if topic.updated %}<a href="{{ topic.last_post.get_absolute_url }}">{% pybb_time topic.updated %}</a>{% endif %}</td>
        </tr>
        {% endfor %}
    </table>
</div>

{% with _('Topics') as label %}
{% include "pybb/pagination.html" %}
{% endwith %}

{% if not user.pybb_profile.is_banned %}
    <div class="controls">
        <a href="{% url pybb_topic_add forum.id %}">{% trans "New topic" %}</a>
    </div>
{% endif %}

{% endblock %}
